package global.security;

/**
 * 设定客户端Session类.
 * <p>
 * 创建日期：2010-07-01<br>
 * 创建人：Xiyt<br>
 * 修改日期：<br>
 * 修改人：<br>
 * 修改内容：<br>
 * 
 * @author Xiyt
 * @version 1.0
 */
public class AuthenticatorHolder {

	static ThreadLocal<ClientSession> clientSessionList = new ThreadLocal<ClientSession>();

	public static void setClientSession(ClientSession clientSession) {
		if(null == clientSessionList){
			clientSessionList = new ThreadLocal<ClientSession>();
		}
		clientSessionList.set(clientSession);
	}

	public static ClientSession getClientSession() {
		if(null == clientSessionList){
			clientSessionList = new ThreadLocal<ClientSession>();
		}
		return (ClientSession) clientSessionList.get();
	}
	
	public static void closeClientSession(){
		clientSessionList.set(null);
		clientSessionList = null;
	}

}
